

const Router = require('koa-router');


//-----------------------
// const homeController = require('./controller/home');
const userController = require('./controller/userController');

const logger = G.logUtils.getLogger(__filename);

const router = function (app) {

    logger.info('------init routers------');

    // TODO:
    // 可以继续细分
    // test
    // glbRouter.get('/test',homeController.test);
    // glbRouter.get('/testError',homeController.testError);

    const glbRouter = new Router();
    glbRouter.get('/user/login',userController.login);
    glbRouter.get('/user/sync',userController.sync);


    app.use(glbRouter.routes()).use(glbRouter.allowedMethods());

    return async ctx=>{}
};

module.exports = router;
